#ifndef FORMDOCAPPLY_H
#define FORMDOCAPPLY_H

#include <QWidget>
#include <QSqlQuery>
#include <QListWidgetItem>
#include <QSqlQueryModel>
#include <QTimer>

namespace Ui {
class RecipeManage;
}

class RecipeManage : public QWidget
{
    Q_OBJECT

public:
    explicit RecipeManage(QWidget *parent = nullptr);
    ~RecipeManage();

signals:
    void destroyW( QString );

private slots:
    void closeEvent(QCloseEvent *event);
    void on_pb_exit_clicked();
    void on_pb_save_clicked();
    void on_tm_init_timeout();

    void on_tv_oper_clicked(const QModelIndex &index);

    void on_tv_oper_doubleClicked(const QModelIndex &index);

    void on_pb_fresh_clicked();

    void on_pb_invoice_return_clicked();

    void on_pb_search_clicked();

    void on_tv_unused_invoice_clicked(const QModelIndex &index);

    void on_tv_unused_invoice_doubleClicked(const QModelIndex &index);

private:
    Ui::RecipeManage *ui;
    QSqlQuery *qro, *qrm;
    QSqlQueryModel *md_oper, *md_invoice, *md_unused;   //收款员列表，发票列表
    QString sq;
    int cur_max_sn;  //当前最大收据号

    QTimer *tm_init; //窗口初始化显示
};

#endif // FORMDOCAPPLY_H
